package com.xinqi.controller;

import com.xinqi.bean.User;
import com.xinqi.common.R;
import com.xinqi.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import lombok.extern.slf4j.Slf4j;

/**
 * @author xin麒
 * @date 2023/1/14 20:21
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {
    @GetMapping("/hello")
    public R<String> hello(){
        return R.success("hello");
    }

    @Autowired
    private UserService userService;

    @PostMapping("/register")
    public R<User> register(@RequestBody User user){
        return userService.register(user);}
}
